package com.ssy.lingxi.member.merchant.api.model.vo.inner.request;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.io.Serializable;
import java.util.Objects;

/**
 * 上下级会员关系VO
 * @author 万宁
 * @version 2.0.0
 * @date 2020-10-20
 */
public class MemberFeignRelationVO implements Serializable {
    private static final long serialVersionUID = -7188281984199020338L;

    /**
     * 上级会员Id
     */
    @NotNull(message = "上级会员Id要大于0")
    @Positive(message = "上级会员Id要大于0")
    private Long upperMemberId;

    /**
     * 上级会员角色Id
     */
    @NotNull(message = "上级会员角色Id要大于0")
    @Positive(message = "上级会员角色Id要大于0")
    private Long upperRoleId;

    /**
     * 下级会员Id
     */
    @NotNull(message = "下级会员Id要大于0")
    @Positive(message = "下级会员Id要大于0")
    private Long subMemberId;

    /**
     * 下级会员角色Id
     */
    @NotNull(message = "下级会员角色Id要大于0")
    @Positive(message = "下级会员角色Id要大于0")
    private Long subRoleId;

    public Long getUpperMemberId() {
        return upperMemberId;
    }

    public void setUpperMemberId(Long upperMemberId) {
        this.upperMemberId = upperMemberId;
    }

    public Long getUpperRoleId() {
        return upperRoleId;
    }

    public void setUpperRoleId(Long upperRoleId) {
        this.upperRoleId = upperRoleId;
    }

    public Long getSubMemberId() {
        return subMemberId;
    }

    public void setSubMemberId(Long subMemberId) {
        this.subMemberId = subMemberId;
    }

    public Long getSubRoleId() {
        return subRoleId;
    }

    public void setSubRoleId(Long subRoleId) {
        this.subRoleId = subRoleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        MemberFeignRelationVO that = (MemberFeignRelationVO) o;
        return Objects.equals(upperMemberId, that.upperMemberId) &&
                Objects.equals(upperRoleId, that.upperRoleId) &&
                Objects.equals(subMemberId, that.subMemberId) &&
                Objects.equals(subRoleId, that.subRoleId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(upperMemberId, upperRoleId, subMemberId, subRoleId);
    }
}
